const http = require('http')
const path = require('path')
const fs = require('fs')
const url = require('url')
// 得到一个webserver对象
http.createServer((req, res) => {

  if ('/favicon.ico' != req.url) {
    // 获取当前的url地址
    let { pathname, query } = url.parse(req.url, true);
    // 给request对象添加一个自定义的属性
    req.query = query
    console.log(query);
  }



  // 字符串，buffer数据流二进制
  res.end('aaa')

}).listen(3000, '127.0.0.1', () => console.log('服务器启动'))


